package com.whut.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.whut.entity.Courier;
import com.whut.mapper.CourierMapper;
import com.whut.service.CourierService;
import org.springframework.stereotype.Service;

@Service
public class CourierServiceImpl extends ServiceImpl<CourierMapper, Courier>
        implements CourierService {
    /**
     * 根据手机号查询快递员
     * @param phone
     * @return
     */
    @Override
    public Courier findByPhone(String phone) {
        LambdaQueryWrapper<Courier> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Courier::getSysPhone, phone);
        Courier courier = this.getOne(queryWrapper);
        return courier;
    }
}
